package com.lkd.controller;

import com.lkd.dto.ReportDto;
import com.lkd.dto.UserDto;
import com.lkd.entity.User;
import com.lkd.service.IOrderService;
import com.lkd.service.IUserService;
import com.lkd.vo.PageBean;
import com.lkd.vo.Result;
import com.lkd.vo.UserVo;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequiredArgsConstructor
@RequestMapping("/api/user-service/report")
public class ReportController {

    @Autowired
    private IOrderService  orderService;

    @GetMapping("orderCount")
    public Result getReport(ReportDto reportDto){
        Integer count = orderService.searchByTime(reportDto);
        return Result.success(count);
    }

    @GetMapping("orderAmount")
    public Result getOrderAmount(ReportDto reportDto){
        Integer count = orderService.getOrderAmountByTime(reportDto);
        return Result.success(count);
    }


}
